Working With Channel Devices
Sequence grabbers provide a number of functions that allow you to determine the device that is attached to a given sequence grabber channel. These devices allow the channel component to control the digitizing equipment. For example, video channels use video digitizer components, and sound channels use sound input drivers. Your application can use these routines to present a list of available devices to the user, allowing the user to select a specific device for each channel.You may use the
SGGetChannelDeviceList
function to retrieve a list of devices that may be used with a specified channel. You dispose of this device list by calling theSGDisposeDeviceList
function. You can place one or more device names into a menu by calling theSGAppendDeviceListToMenu
function. You can use theSGSetChannelDevice
function to assign a device to a channel.Some of these functions use a device list structure to pass information about one or more channel devices. The
SGDeviceListRecord
data type defines the format of the device list structure.
typedef struct SGDeviceListRecord { short count; /* count of devices */ short selectedIndex; /* current device */ long reserved; /* set to 0 */ SGDeviceName entry[1]; /* device names */ } SGDeviceListRecord, *SGDeviceListPtr, **SGDeviceList;Device list structures contain an array of device name structures. Each device name structure identifies a single device that may be used by the channel. The
Field Description
count
- Indicates the number of devices described by this structure. The value of this field corresponds to the number of entries in the device name array defined by the
entry
field.selectedIndex
- Identifies the currently active device. The value of this field corresponds to the appropriate entry in the device name array defined by the
entry
field. Note that this value is 0-relative; that is, the first entry has an index number of 0, the second's value is 1, and so on.reserved
- Reserved for Apple. Always set to 0.
entry
- Contains an array of device name structures. Each structure corresponds to one valid device. The
count
field indicates the number of entries in this array. TheSGDeviceName
data type defines the format of a device name structure; this data type is discussed next.SGDeviceName
data type defines the format of a device name structure.
typedef struct SGDeviceName { Str63 name; /* device name */ Handle icon; /* device icon */ long flags; /* flags */ long refCon; /* set to 0 */ long reserved; /* set to 0 */ } SGDeviceName;Field descriptions
name
- Contains the name of the device. For video digitizer components, this field contains the component's name as specified in the component resource. For sound input drivers, this field contains the driver name.
icon
- Contains a handle to the device's icon. Some devices may support an icon, which you may choose to present to the user. If the device does not support an icon, or if you choose not to retrieve this information (by setting the
sgDeviceListWithIcons
flag to 0 when you call theSGGetChannelDeviceList
function), this field is set tonil
.flags
- Reflects the current status of the device. The sequence grabber sets these flags when you retrieve a device list. The following flag is defined:
sgDeviceNameFlagDeviceUnavailable
- When set to 1, this flag indicates that this device is not currently available.
refCon
- Reserved for Apple. Always set to 0.
reserved
- Reserved for Apple. Always set to 0.
Subtopics
- SGGetChannelDeviceList
- SGDisposeDeviceList
- SGAppendDeviceListToMenu
- SGSetChannelDevice
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help